FIG. 1 shows a conventional encoder incorporating a data compression circuit which produces a data compressed digital signal having equal length blocks.
In FIG. 1, an input analog signal, such as an analog signal representing an audio signal, is converted into a PCM digital signal by the analog to digital (A/D) converter 101. The PCM digital signal is arranged into plural frames. Each frame includes a predetermined number of samples of the PCM digital signal. The band dividing filter 102 divides the PCM digital signal in frequency into a number of frequency ranges, for example, two frequency ranges. The frequency range signals, one for each frequency range, are transmitted to the scaling factor calculating circuits 108 and 113. Each of the scaling factor calculating circuits determines a scaling factor for its respective frequency range signal.
The scaling factors are fed into the scaling factor quantizing circuits 109 and 114, where the scaling factors are quantized using a predetermined number of bits. The resulting quantized scaling factors are transmitted to the scaling factor dequantizing circuits 110 and 115, and to the multiplexer 105.
Each of the scaling factor dequantizing circuits 110 and 115 dequantizes its respective quantized scaling factor. The resulting dequantized scaling factors are transmitted to the quantizing circuits 106 and 108, and to the quantizing bit number decision circuit 116. The quantizing bit number decision circuit sets the number of quantizing bits for quantizing each frequency range signal.
The quantizing bit numbers are transmitted to the quantizing circuits 103 and 111, where the two frequency range signals from the band dividing filter 102 are equal length coded using their respective dequantized scaling factors and the quantizing bit numbers. The resulting coded frequency range signals are fed into the multiplexer 105, which multiplexes together the respective equal length coded frequency range signals and the quantized scaling factors to provide an output bit stream. The output bit stream has a constant bit rate that is suitable for feeding into a transmission channel or recording/reproducing system, such as a digital audio tape recorder, that requires a constant bit-rate bit steam.
FIG. 2 shows a conventional decoding apparatus for deriving an analog signal from an equal length coded compressed digital signal reproduced from a transmission channel or recording medium in equal length blocks. The decoding apparatus includes a complementary data expander for expanding the compressed digital signal.
In the decoder shown in FIG. 2, a bit-stream of a data-compressed digital signal produced by, for example, the encoder shown in FIG. 1, and reproduced from a transmission channel or recording medium, is demultiplexed by the demultiplexer 203 into an equal length coded frequency range signal and a quantized scaling factor for each frequency range. The quantized scaling factor for each frequency range is dequantized by the scaling factor dequantizing circuits 208 and 211. The dequantized scaling factors are then transmitted to the dequantizing circuits 205 and 210, and to the quantization bit number decision circuit 213. The dequantizing circuits 205 and 210 decode the equal length coded frequency range signals from the demultiplexer 203 using the quantization bit numbers and the dequantized scaling factors for each respective frequency range. The frequency synthesizer 206 synthesizes the decoded frequency range signals and provides a synthesized output signal for conversion back to an analog signal by the digital to analog converter 205
FIGS. 3 and 4 show unequal length coding added to an equal length coding compressor employed in a digital encoder, such as that shown in FIG. 1, and to an equal length coding expander in a digital decoder, such as that shown in FIG. 2.
Unequal length coding, also known as variable length coding, is a coding system in which the length of a code allocated to code a data point, such as a data point representing the amplitude of a sample of an analog signal, is changed with the probability of occurrence of the data point. The length of a code is the number of bits in the code. In unequal length coding, a shorter code is allocated to code a data point that has a higher probability of occurring and a longer code is allocated to code a data point that has a lower probability of occurring. This reduces the number of bits required to code a plurality of normally distributed data points, for example, to code one frame of a digital input signal. The data compression efficiency is thereby increased. A typical variable length coding system is the Huffman code system.
In unequal length coding, code is allocated among the data points according to one or more statistical models, such as a Gaussian distribution or a Laplacian distribution. Since, according to such distributions, there is a higher probability of smaller input signal amplitudes occurring, shorter codes are allocated to smaller amplitudes, and longer codes are allocated to larger amplitudes, respectively.
FIGS. 3 and 4 show examples of a conventional encoder incorporating a data compressor with unequal length coding, and a conventional decoder incorporating an expander for an unequal length coded compressed digital signal.
The encoder in FIG. 3 is based on the encoder shown in FIG. 1. In the encoder shown in FIG. 3, the connections between the quantizing circuits 103 and 111 and the multiplexer 105 are intercepted by the unequal length coding circuits 104 and 112, respectively. The unequal length coding circuits 104 and 112 also receive quantizing bit numbers from the quantizing bit number decision circuit 116. In response to the quantizing bit numbers, the unequal length coding circuits unequal length code the quantized frequency range signals. The unequal length coded frequency range signals, which have a different number of bits in each frame, are fed into the multiplexer 105.
The multiplexer multiplexes together the unequal length coded frequency range signals and the quantized scaling factors and feeds a bit stream into the buffer 106, where it is temporarily stored. The bit stream has a varying bit rate because the number of bits in each frame varies from frame-to-frame as a result of the unequal length coding.
A bit stream is read out of the buffer 106 at a constant bit rate suitable for feeding into a transmission channel or a recording and reproducing system, such as a digital audio tape recorder, that requires a constant bit-rate bit steam.
Since the construction and operation of the encoder using unequal length coding shown in FIG. 3 is otherwise the same as that of the encoder using equal length coding shown in FIG. 1, and the same components in the drawings are indicated by the same numerals, the corresponding description is omitted for brevity.
A decoder incorporating a complementary data expander for an unequal length coded compressed digital signal is shown in FIG. 4. The decoder shown in FIG. 4 is similar to the decoder incorporating an expander for equal length coded signals shown in FIG. 2. In the decoder shown in FIG. 4, a bit stream, including frames each having a different number of bits, is received at a constant bit rate from the transmission channel or the reproducing system (not shown) and is stored in the buffer 201. The bit stream is read out of the buffer at a non-constant bit rate into the multiplexer 203, which demultiplexes the bit stream into an unequal length coded frequency range signal and a quantized scaling factor for each frequency range, for example, for two frequency ranges.
The connections between the demultiplexer 203 and the dequantizing circuits 205 and 210 in the decoder shown in FIG. 2 are interrupted in the expander shown in FIG. 4 by the unequal length decoding circuits 204 and 209, respectively. The unequal length decoding circuits 204 and 209 also receive quantizing bit number data from the quantizing bit number decision circuit 211.
The two unequal length coded frequency range signals are fed from the demultiplexer 201 into the unequal length decoding circuits 204 and 209, where the unequal length coding is decoded. The resulting quantized frequency range signals are supplied to the dequantizing circuits 205 and 210, where they are equal length decoded.
Since the construction and operation of the decoder for unequal length coded signals shown in FIG. 4 is otherwise the same as that of the decoder for equal length coded signals shown in FIG. 2, and the same components in the drawings are indicated by the same numerals, the corresponding description is omitted for brevity.
In the encoder and the decoder shown in FIGS. 3 and 4, respectively, since the transmission system or the recording and/or reproduction system requires a bit stream having a constant bit rate, a buffer must be provided on the output of the encoder and on the input of the decoder if real-time recording and reproduction is desired. The state of a buffer in the encoder at a given time is represented by EQU B(n)=B(n-1)+Bin(n)-Bout(n) [bits] (1)
where n indicates the nth update cycle of the buffer, B(n) indicates the volume of data stored in the buffer, Bin(n) the volume of data written into the buffer in the nth cycle, and Bout(n) the volume of data read out of the buffer in the nth cycle.
In the formula (1), Bin(n) varies because of the unequal length coding, and Bout(n) is constant because the output bit rate is constant. If unequal length coding allocates a high concentration of longer codes, and the volume of data written into the buffer exceeds the volume of data read out from the buffer for several update cycles, the buffer may overflow. In this case, the volume of data B(n) to be stored in the buffer exceeds the data capacity of the buffer Bmax (B(n)&gt;Bmax). Conversely, if unequal length coding allocates a high concentration of shorter codes, and the volume of written into the buffer falls below the volume of data read out from the buffer for several update cycles, the buffer may underflow. In this case, the buffer runs out of data for transmission or recording (B(n)&lt;0).
Known methods of overcoming these problems include:
(a) using a buffer with a larger capacity, or PA1 (b) changing the scaling factor such that buffer overflow or underflow is inhibited in circumstances in which overflow or underflow is likely to occur.
With the measure (b), the buffer state is monitored so that, if it appears that an overflow is likely, the scaling factor is increased to reduce the amplitude of the signals to be coded. Since unequal length coding allocates shorter codes to smaller amplitude signals, increasing the scaling factor helps prevent buffer overflow. Conversely, if it appears that an underflow is likely, the scaling factor is decreased to increase the amplitude of the signals to be coded. Since unequal length coding allocates longer codes to larger amplitude signals, decreasing the scaling factor helps prevent buffer underflow.
The above measure (a) of using a buffer with a larger capacity leads to increased hardware complexity, and the measure (b) of changing the scaling factor makes it impossible to obtain desired performance characteristics.